<!--h5 -->
<div class="isH5 isPad nav_table">
  <a class="navbar-brand home" href="{{ i18n "home_link" }}">
    <img src="{{ .Site.BaseURL }}{{ .Site.Params.logo }}" alt="{{ .Title }} logo" class="hidden-xs hidden-sm">
    <img src="{{ .Site.BaseURL }}{{ .Site.Params.logo_small }}" alt="{{ .Title }} logo" class="visible-xs visible-sm">
    <span class="sr-only">{{ .Title }} - {{ i18n "navHome" }}</span>
  </a>
  <ul class="topbar">
    <li class="search">
      <img src="/img/earth.svg">
      {{$curURL:= .RelPermalink}}
      {{$curDir:= substr $curURL 4}}
      {{ range .Site.Menus.main }}
      {{ if eq .Identifier "lang" }}
      {{$newLan := .URL}}
      {{$newPath := (print $newLan "/" $curDir)}}
      <a class="list" href="{{ $newPath }}">{{ .Name }}</a>
      {{ end  }}
      {{ end  }}
      <i></i>
    </li>
    <li class="flex" onclick="getList('menu')" style="position:relative">
      <img src="/img/nav.svg" alt="Navigation">
    </li>
  </ul>
  <div id="nav">
    {{ range .Site.Menus.main }}
    {{ $currentId:= .Identifier }}
    {{ if ne $currentId "lang" }}
    {{ if .HasChildren }}
    <p class="second_menu" onclick="getList('#second_menu_{{ $currentId }}')">{{ .Name }}
      <i></i>
    </p>
    <div class="menu_list" id="second_menu_{{ $currentId }}">
      {{ range .Children }}
      <a class="list" href="{{ .URL }}">
        <p>{{ .Name }}</p>
      </a>
      {{ end }}
    </div>
    {{ else }}
    <a class="list" href="{{ .URL }}">
      <p>{{ .Name }}</p>
    </a>
    {{ end  }}
    {{ end  }}
    {{ end  }}
    <a href={{ i18n "main_wechat_url" }} class="list list_wechat">
      <p>
        <img style="width:18px;" src="{{ .Site.BaseURL }}img/weixin.png">
        {{ i18n "main_wechat" }}
      </p>
    </a>

    <a class="list" href="https://gitee.com/opengauss" target="_blank">
      <p>
        <img style="width:18px;" src="{{ .Site.BaseURL }}img/gitee-logo.ico">
        {{ i18n "main_gitee" }}
      </p>
    </a>

    <a class="list" href="https://github.com/opengauss-mirror" target="_blank">
      <p>
        <img style="width:18px;" src="{{ .Site.BaseURL }}img/github.png">
        GitHub
      </p>
    </a>
    
  </div>
</div>


<div class="isPc navbar-affixed-top" data-spy="affix" data-offset-top="67">

  <div class="navbar navbar-default yamm" role="navigation" id="navbar">
    <div class="container">
      <div class="navbar-header">
        <a class="navbar-brand home" href="{{ i18n "home_link" }}">
          <img src="{{ .Site.BaseURL }}{{ .Site.Params.logo }}" alt="{{ .Title }} logo" class="hidden-xs hidden-sm">
          <img src="{{ .Site.BaseURL }}{{ .Site.Params.logo_small }}" alt="{{ .Title }} logo"
            class="visible-xs visible-sm">
          <span class="sr-only">{{ .Title }} - {{ i18n "navHome" }}</span>
        </a>
        <div class="navbar-buttons">
          <button type="button" class="navbar-toggle btn-template-main" data-toggle="collapse"
            data-target="#navigation">
            <span class="sr-only">{{ i18n "navToggle" }}</span>
            <i class="fa fa-align-justify"></i>
          </button>
        </div>
      </div>
      <!--/.navbar-header -->
      <div class="navbar-collapse collapse" id="navigation">
        <ul class="nav navbar-nav navbar-left">
          {{ $current := . }}
          {{ range .Site.Menus.main }}
          {{ $topLevel := replace .URL "/" "" }}
          {{ $isChildren := false }}
          {{ range .Children }}
          {{ if eq .Identifier $current.Type }}
          {{ $isChildren = true }}
          {{ end }}
          {{ end }}
          {{ if ne .Identifier "lang" }}
          <li
            class="dropdown{{ if eq $current.RelPermalink .URL | or $isChildren | or (eq (trim $current.RelPermalink "/") $topLevel) | or (eq $current.Type .Identifier) | or (eq $current.Type $topLevel) | or (and (eq (default (trim .URL "/") .Identifier) "video") (in (slice "taxonomy" "taxonomyTerm") $current.Kind)) }} active{{ end }}">
            {{ if .HasChildren }}
            <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
              aria-expanded="false">{{ .Name }} <span class="caret"></span></a>
            <ul class="dropdown-menu">
              {{ range .Children }}
              <li><a href="{{ .URL }}">{{ .Name }}</a></li>
              {{ end }}
            </ul>
            {{ else }}
            {{ if eq .Identifier "blog"}}
            <a href="{{ .URL }}">{{ .Name }}</a>
            {{ else if eq .Identifier "forum"}}
            <a href="{{ .URL }}" target="_blank">{{ .Name }}</a>
            {{ else }}
            <a href="{{ .URL }}">
              {{ if eq .Identifier "join" }}
              <svg class="contact" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 21 16">
                <path d="M10.5,10.5c-0.3,0-0.7-0.1-1.3-0.5L0,5v9.6C0,15.4,0.6,16,1.3,16h18.4c0.7,0,1.3-0.6,1.3-1.4V5
l-9.2,5C11.2,10.4,10.8,10.5,10.5,10.5z M19.7,0H1.3C0.6,0,0,0.6,0,1.3v1L10.5,8L21,2.4v-1C21,0.6,20.4,0,19.7,0z" fill="#ffffff">
                </path>
            </svg>
              {{ end }}
              {{ .Name }}
            </a>
            {{ end }}
            {{ end  }}
          </li>
          {{ end }}
          <!-- {{ if eq .Identifier "lang" }}
          <li style="text-align: center;"
            class=" dropdown{{ if eq $current.RelPermalink .URL | or $isChildren | or (eq (trim $current.RelPermalink "/") $topLevel) | or (eq $current.Type .Identifier) | or (eq $current.Type $topLevel) | or (and (eq (default (trim .URL "/") .Identifier) "blog") (in (slice "taxonomy" "taxonomyTerm") $current.Kind)) }} active{{ end }}">
            <a href="{{ .URL }}">{{ .Name }}</a>
          </li>
          {{ end }} -->
          {{ end }}


          </li>

        </ul>
        <ul class="nav navbar-nav navbar-right">
          <li class="weixin" style="text-align: center;">
            <a class="list" href="https://gitee.com/opengauss" target="_blank">
              <img style="width:18px;" src="{{ .Site.BaseURL }}img/weixin.png">
            </a>
            <div class="wechat">
              <img src="{{ .Site.BaseURL }}img/wechat.jpg">
              <p>{{ i18n "main_wechat_account" }}</p>
            </div>
          </li>
          <li style="text-align: center;" title="{{ i18n "main_gitee" }}">
            <a class="list" href="https://gitee.com/opengauss" target="_blank">
              <img style="width:18px;" src="{{ .Site.BaseURL }}img/gitee-logo.ico">
            </a>
          </li>
          <li style="text-align: center;" title="GitHub">
            <a class="list" href="https://github.com/opengauss-mirror" target="_blank">
              <img style="width:18px;" src="{{ .Site.BaseURL }}img/github.png">
            </a>
          </li>
          {{ $current := . }}
          {{$curURL:= .RelPermalink}}
          {{$curDir:= substr $curURL 4}}
          {{ range .Site.Menus.main }}
          {{ $topLevel := replace .URL "/" "" }}
          {{ $isChildren := false }}
          {{ range .Children }}
          {{ if eq .Identifier $current.Type }}
          {{ $isChildren = true }}
          {{ end }}
          {{ end }}
          {{ if eq .Identifier "lang" }}
          <li
            class="language-li dropdown{{ if eq $current.RelPermalink .URL | or $isChildren | or (eq (trim $current.RelPermalink "/") $topLevel) | or (eq $current.Type .Identifier) | or (eq $current.Type $topLevel) | or (and (eq (default (trim .URL "/") .Identifier) "blog") (in (slice "taxonomy" "taxonomyTerm") $current.Kind)) }} active{{ end }}">
            {{ if .HasChildren }}
            
            <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
              aria-expanded="false"><img class="language-icon" style="width: 18px;margin-right: 5px;" src="{{ $.Site.BaseURL }}img/language.png"><span>{{ .Name }}</span> <span class="caret"></span></a>
            <ul class="dropdown-menu">
              {{ range .Children }}
              {{$newLan := .URL}}
              {{$newPath := (print $newLan "/" $curDir)}}
              <li><a href="{{ $newPath }}">{{ .Name }}</a></li>
              {{ end }}
            </ul>
            {{ end  }}
          </li>
          {{ end }}
          {{ end }}


          </li>
        </ul>
      </div>
      <!--/.nav-collapse -->

      <div class="collapse clearfix" id="search">

        <form class="navbar-form" role="search">
          <div class="input-group">
            <input type="text" class="form-control" placeholder="Search">
            <span class="input-group-btn">

              <button type="submit" class="btn btn-template-main"><i class="fa fa-search"></i></button>

            </span>
          </div>
        </form>

      </div>
      <!--/.nav-collapse -->

    </div>
  </div>
  <!-- /#navbar -->

</div>

<!-- *** NAVBAR END ***-->